import React, { FC } from "react";

const Item = ({ label, required, error, children }) => {
  return (
    <div className="form-item">
      {label && (
        <div className="label">
          {label}
          {required && <span className="required">*</span>}
        </div>
      )}
      <div className="settings">
        {children}
        {error && <div className="error">{error}</div>}
      </div>
    </div>
  );
};

export default Item;
